﻿using System;
using System.IO;
using System.Runtime.Serialization;

namespace DevelopersTestPad.Worksheets
{
    [DataContract]
    public sealed class Worksheet
    {
        /// <summary>
        /// Do not serialize this!
        /// </summary>
        private WorksheetStatus _status = WorksheetStatus.Initialized;

        /// <summary>
        /// The worksheet identifier.
        /// </summary>
        [DataMember]
        public Guid Id { set; get; }

        /// <summary>
        /// The worksheet type.
        /// </summary>
        [DataMember]
        public WorksheetType Type { set; get; }

        /// <summary>
        /// The worksheet text data.
        /// </summary>
        [DataMember]
        public string TextData { set; get; }

        /// <summary>
        /// The worksheet file.
        /// </summary>
        /// <remarks>
        /// Do not serialize this!
        /// </remarks>
        internal FileInfo Location { set; get; }

        /// <summary>
        /// Is this an existing worksheet or a new one.
        /// </summary>
        /// <remarks>
        /// Do not serialize this!
        /// </remarks>
        internal bool Existing { set; get; }

        /// <summary>
        /// The worksheet status.
        /// </summary>
        /// <remarks>
        /// Do not serialize this!
        /// </remarks>
        internal WorksheetStatus Status { set { _status = value; } get { return _status; } }

    }
}
